﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NAccounting
{
    public enum AccountEntryType
    {
        Undefined = 'U',
        Credit = 'C',
        Debit = 'D'
    }

    public partial class AccountEntry
    {
        public bool CanDelete
        {
            get
            {
                return Id > 0 && !Lot.IsClosed;
            }
        }

        public AccountEntryType AccountEntryType
        {
            get 
            {
                var result = Type == "C" ? AccountEntryType.Credit : AccountEntryType.Debit;
                return result; 
            }
        }
    }
}